#pragma once
#include "Common.h"

class CentralCache
{
public:
	static CentralCache* getinstance()
	{
		return &_sInt;
	}
	//获取一个非空的span
	span* getonespan(Spanlist& list, size_t size);
	//给threadcache分配内存
	size_t FetchtoThread(void*& start, void*& end, size_t batchNum, size_t size);


	void RealseListTospan(void* start, size_t size);

private:
	static Spanlist _spanlist[NFREELIST];
	CentralCache()
	{}
	CentralCache(const CentralCache&) = delete;
	static CentralCache _sInt;

};

